import request from '@/utils/request'

/**
 * 获取员工列表
 * @param {*} params {page : 页数. size : 条数}
 * @returns Promise对象
 */
export function getEmployeesListAPI (params) {
  return request({
    url: '/sys/user',
    method: 'GET',
    params
  })
}

/**
 * 删除员工
 */
export function delEmployeeAPI (employeesId) {
  return request({
    url: `/sys/user/${employeesId}`,
    method: 'DELETE'
  })
}

/**
 * 添加员工
 */
export function addEmployeeAPI (data) {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

/**
 * 批量导入员工
 */
export function importEmployeeAPI (data) {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

/**
 * 修改员工基本信息
 * 根据员工id, 更新员工基本信息
 */
export function updateEmployeesAPI (empObj) {
  return request({
    url: `/sys/user/${empObj.id}`,
    method: 'PUT',
    data: empObj
  })
}
